<me:UIRQI03 x:Class="WPFExcelReport.TMRQI03"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
                    xmlns:WB="clr-namespace:WPFExcelReport;assembly=TWBDAT" 
                    xmlns:ER="clr-namespace:WPFExcelReport;assembly=TWBFEHL"
                    xmlns:FK="clr-namespace:WPFExcelReport;assembly=TWBFKOPF"
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                    xmlns:AM="clr-namespace:WPFExcelReport;assembly=TAMSTAMM"  
                    xmlns:HR="clr-namespace:WPFExcelReport;assembly=THRSTAMM" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    x:Name="TV"
                    FontSize="20"
                    Loaded="Window_Loaded"
     >
    <me:UIRQI03.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:TextTrimmingConverter x:Key="trim"/>
    </me:UIRQI03.Resources>
    <TabControl>
        <TabItem Header="{Binding Source={Localization:Translate Word=疵点录入}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"></ColumnDefinition> 
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0"  Grid.ColumnSpan="2"
                Margin="10,0,0,0" VerticalAlignment="Top"> 
                    <WrapPanel VerticalAlignment="Center" Margin="0,10,0,0" >
                        <Button Content="{Binding Source={Localization:Translate Word=新卷号:}}"  FontSize="20" Width="80" Height="40"
                                Click="NewWBCommand"  VerticalAlignment="Center"/>
                        <ex:TXT72 MaxLength="12" Grid.Column="1"    Name="cWB"  Margin="20,0,0,0" 
                              KeyUp="Query_KeyUp" CharacterCasing="Upper"
                              TabIndex="1"
                              Text="{Binding STKNR,ElementName=TV}" Width="180" VerticalAlignment="Center"/>
                        <Button   Click="QueryCommand"    VerticalAlignment="Center" Width="40" Height="40" Margin="20,0,0,0">
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                            </Button.Background>
                        </Button>
                        <WrapPanel VerticalAlignment="Center">
                            <TextBlock   VerticalAlignment="Center"  Margin="20,0,0,0"   Text="{Binding Source={Localization:Translate Word=卷号:}}" FontSize="20" ></TextBlock>
                            <TextBlock Text="{Binding WBBSTKNR,Converter={StaticResource trim}}" Grid.Column="1" Margin="20,0,0,0" HorizontalAlignment="Left"  Width="160" />
                            <TextBlock   VerticalAlignment="Center"   Margin="20,0,0,0" Text="{Binding Source={Localization:Translate Word=长度:}}" FontSize="20"></TextBlock>
                            <TextBlock Text="{Binding WBBISTKLG,Converter={StaticResource d1000}}" Margin="20,0,0,0" HorizontalAlignment="Left"  Width="80" />  
                        </WrapPanel>
                        <WrapPanel Visibility="Collapsed">
                            <TextBlock Text="{Binding Source={Localization:Translate Word=验布机:}}"  
                                       Margin="20,0,0,20" VerticalAlignment="Center" />
                            <Button Content="{Binding MACHINEID,ElementName=TV}" VerticalAlignment="Center" Margin="20,0,0,0" Width="Auto" Click="QIAMChg"  />
                        </WrapPanel>                       
                        <Button   Click="SaveCommand"  Height="40"   Margin="20,0,0,0" Width="40" VerticalAlignment="Center" >
                                <Button.Background>
                                    <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                                </Button.Background>
                            </Button>
                            <DR:TDRAUFTR  Grid.Column="0" Name="cDR" Visibility="Collapsed"
                                          DocType="{Binding PRTYPE,ElementName=TV}"
                                         PrintType="DirectPrint" />
                        <Button  Grid.Column="1"   Click="PrintLBCommand"  Margin="20,0,0,0" Width="80" Height="40"  FontSize="18"  
                         Content="{Binding Source={Localization:Translate Word=标签}}" />

                    </WrapPanel>
                    <WrapPanel  Margin="0,10,0,10" VerticalAlignment="Center" > 
                        <TextBlock   VerticalAlignment="Center"   Margin="35,0,0,0" Width="50" Text="{Binding Source={Localization:Translate Word=幅宽:}}"></TextBlock>
                        <ex:TXT72  Margin="15,0,0,0" FontSize="24" Text="{Binding BRT,ElementName=TV,Converter={StaticResource d1000}}" IsAutoClear="True" Width="80" VerticalAlignment="Center" TextAlignment="Center"/>
                        <TextBlock Text="{Binding Source={Localization:Translate Word=cm}}" VerticalAlignment="Center" Margin="10,0,0,0"  />
                        <TextBlock   VerticalAlignment="Center"   Margin="35,0,0,0" Width="50" Text="{Binding Source={Localization:Translate Word=纬密:}}"></TextBlock>
                        <ex:TXT72 Text="{Binding WBBHHK1,Converter={StaticResource d1000}}" IsAutoClear="True" FontSize="24" VerticalAlignment="Center" Width="80" TextAlignment="Center" Margin="15,0,0,0" />
                        <TextBlock Text="{Binding Source={Localization:Translate Word=cm}}" VerticalAlignment="Center" Margin="15,0,35,0"  />
                        <SD:QLTBOX QUALITY="{Binding QUALITY,ElementName=TV}"/>
                        <TextBlock  Margin="5,0,0,0" Text="{Binding Source={Localization:Translate Word=等级: }}"  VerticalAlignment="Center" FontSize="16"  />
                        <Label HorizontalContentAlignment="Center" FontSize="24" VerticalContentAlignment="Center" Content="{Binding WBBZENSURKZ}"  Background="Yellow" Width="60" Height="40" VerticalAlignment="Center" />

                    </WrapPanel>
                    <WrapPanel  Grid.Row="3" Grid.Column="0"  Grid.ColumnSpan="2" VerticalAlignment="Center">
                        <WrapPanel Width="auto">
                            <HR:THR20ITX
                                        MachineName="{Binding LOOMID,ElementName=TV}"
                                        KEY="{Binding SHIFTPRODUCTION,ElementName=pbWB19DC}"
                                        />
                        </WrapPanel>
                        <WrapPanel Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Margin="20,0,0,0">
                            <TextBlock Text="{Binding CMTR,ElementName=TV,Converter={StaticResource d1000}}" 
                                       FontSize="32" Background="Pink" VerticalAlignment="Center"
                                       Width="150"/>
                            <ex:NumericBox Text="{Binding CMTR,ElementName=TV,Converter={StaticResource d1000}}" 
                                Margin="20,0,0,0" 
                               DecimalPlaces="1"
                               FontSize="32" VerticalAlignment="Center" HorizontalAlignment="Center"
                                 Width="150"/>
                        </WrapPanel>
                    </WrapPanel>
                    <WrapPanel Visibility="Collapsed">
                        <FK:TWB18 Name="cFK"
                                EXAUF="{Binding RWAUF,ElementName=TV}"
                                IsAuto="{Binding IsEdit,ElementName=TV}"
                                IsEdit="{Binding IsEdit,ElementName=TV}"
                                IsSaved="{Binding IsSaved,ElementName=TV}"
                                ERVER="{Binding ERVER,ElementName=TV}"/>
                    </WrapPanel>
                </StackPanel> 
                <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,20,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition Width="auto"/>
                    </Grid.ColumnDefinitions>
                    <ER:TWB19X Grid.Column="0"
                            IsAuto="True"
                               Name="pbWB19"   
                            IsEdit="{Binding IsEdit,ElementName=cFK}"
                            EXAUF="{Binding KEY,ElementName=cFK}"
                            CMTR="{Binding CMTR,ElementName=TV}"
                            DFFSCHL="{Binding DFFSCHL,ElementName=cFK}" /> 
                    <ER:TWB19DC  Grid.Column="1" Name="pbWB19DC" 
                                  IsEdit="True"
                                  VAR="{Binding VAR,ElementName=pbWB19}" 
                                  DES="{Binding KEY,ElementName=cRK}" 
                                  CMTR="{Binding QTY,ElementName=TV}"/>
                </Grid> 
            </Grid>
        </TabItem>
     
        <TabItem Header="{Binding Source={Localization:Translate Word=当班记录}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <me:TWBQI03
                    Grid.Row="1" 
                       MACHINEID="{Binding  MACHINEID,ElementName=TV}" 
                    />
            </Grid>

        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=品种信息}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <WS:TWASTAMM
                        Name="cWS"
                        ORDERNUM="{Binding WAART,ElementName=TV}"/>
            </Grid>

        </TabItem> 
        <TabItem Header="{Binding Source={Localization:Translate Word=疵点历史}}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <TextBlock  Grid.Row="0" Text="{Binding INFO,ElementName=cWB18}"></TextBlock>
                <ER:TWB18X Name="cWB18"
                           Grid.Row="1"
                           EXAUF="{Binding KEY,ElementName=cFK}"   />
            </Grid>

        </TabItem> 
    </TabControl>
  
</me:UIRQI03>
